/*
 * @Author: wangc
 * @Date: 2021-03-15 12:54:06
 * @Description: yarn  纱线  8087
 */
import { request } from '@/utils/request'

// 二维码返回信息
export function getTaskStep(data, callBack) {
    return request({
        url: '/task_step/list_to_do_4_worker',
        method: 'get',
        data,
        isYarn: true,
        isResUrl: true
    }, callBack)
}

// 接单
// export function getTaskAccept(data, callBack) {
//     return request({
//         url: '/task_step/accept',
//         method: 'post',
//         data,
//         type: 'json',
//         isYarn: true
//     }, callBack)
// }


// 领纱员 获取纱线信息
export function getYarnList(data, callBack) {
    return request({
        url: '/sample_yarn_4_plan/list_by_plan_type',
        method: 'get',
        data,
        isYarn: true,
        isResUrl: true
    }, callBack)
}

// 领纱员 获取下一步信息
export function getNextInfo(data, callBack) {
    return request({
        url: '/flow_template/next_step',
        method: 'get',
        data,
        isYarn: true,
        isJoin: true
    }, callBack)
}

// 领纱员 确认提交 
export function getNextCommit(data, callBack) {
    return request({
        url: '/flow_task/commit',
        method: 'post',
        data,
        type: 'json',
        isYarn: true
    }, callBack)
}

// 仓库员 单个纱料信息
export function getYarn4Worker(data, callBack) {
    return request({
        url: '/sample_yarn_4_plan/query_4_worker',
        method: 'get',
        data,
        isYarn: true,
        isResUrl: true,
        // isEmpty: true
    }, callBack)
}



// 待办
export function getTaskToDo(data, callBack) {
    return request({
        url: '/task_step/list_step_to_do',
        method: 'get',
        data,
        isYarn: true,
        // isEmpty: true
    }, callBack)
}

// 待办 todoUrl
export function getTaskToDoUrl(data, callBack) {
    return request({
        url: '',
        method: 'get',
        data,
        isYarn: true,
        isResUrl: true
    }, callBack)
}

// 在办列表
export function getTaskDoing(data, callBack) {
    return request({
        url: '/task_step/list_step_doing',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 在办列表  为空处理
export function getTaskEmptyDoing(data, callBack) {
    return request({
        url: '/task_step/list_step_doing',
        method: 'get',
        data,
        isYarn: true,
        isEmpty: true
    }, callBack)
}

// 纱料包装过滤
export function getYarnPackageFilter(data, callBack) {
    return request({
        url: '/yarn_package/get',
        method: 'get',
        data,
        isId: true,
        isYarn: true
    }, callBack)
}

// 获取细纱详情
export function loadYarnDetail(data, callBack) {
    return request({
        url: '/yarn_standard/get',
        method: 'get',
        data,
        isId: true,
        isYarn: true
    }, callBack)
}

// 生产入库提交
export function getYarnStoreIn(data, callBack) {
    return request({
        url: '/yarn_store_in/batch_in',
        method: 'post',
        data,
        type: 'json',
        isYarn: true
    }, callBack)
}


// 化零出库提交
export function getYarnStoreOut(data, callBack) {
    return request({
        url: '/yarn_store_out/batch_out',
        method: 'post',
        data,
        type: 'json',
        isYarn: true
    }, callBack)
}

// 出库列表
export function loadYarnStoreOutData(data, callBack) {
    return request({
        url: '/yarn_store_out/list',
        method: 'get',
        data,
        isYarn: true,
    }, callBack)
}

// 纱线出库
export function getYarnStoreOutSingle(data, callBack, callErr) {
    return request({
        url: '/yarn_store_out/out_4_weaving',
        method: 'post',
        data,
        type: 'json',
        isYarn: true,
    }, callBack, callErr)
}


// 纱线出库  接单
export function getTaskAccept(data, callBack) {
    return request({
        url: '/task_step/accept',
        method: 'post',
        data,
        type: 'json',
        isYarn: true,
        isAcept: true
    }, callBack)
}

// 领料 详情
export function getWeavingPlanData(data, callBack) {
    return request({
        url: '/weaving_plan_data/list_by_step',
        method: 'get',
        data,
        isYarn: true,
    }, callBack)
}

// resUrl 全链接请求接口    获取领料循环次数 / 纱线出库扫码返回
export function getWeavingPlan(data, callBack) {
    return request({
        url: '',
        method: 'get',
        data,
        isYarn: true,
        isResUrl: true
    }, callBack)
}

// 配置列表
export function getByType(data, callBack) {
    return request({
        url: '/prop/list',
        method: 'get',
        data
    }, callBack)
}

// 規格筛选
export function getYarnStandardFilter(data, callBack) {
    return request({
        url: '/yarn_standard/filter',
        method: 'get',
        data,
        isJoin: true,
        isYarn: true,
        isKong: true,
        isEmpty: true
    }, callBack)
}

// 系列筛选
export function getYarnSeriesFilter(data, callBack) {
    return request({
        url: '/yarn_series/filter',
        method: 'get',
        data,
        isJoin: true,
        isYarn: true,
        isSeries: true
    }, callBack)
}

// 新增盘库
export function getStoreCheck(data, callBack) {
    return request({
        url: '/yarn_store_check/check',
        method: 'post',
        data,
        type: 'json',
        isYarn: true
    }, callBack)
}

// 色号新增
export function getYarnColorAdd(data, callBack) {
    return request({
        url: '/yarn_color/add',
        method: 'post',
        data,
        type: 'json',
        isYarn: true
    }, callBack)
}

// 配置列表
export function getByPackageType(data, callBack) {
    return request({
        url: '/yarn_package/list_yarn_spindle_color',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 纱料包装新增
export function getYarnPackageAdd(data, callBack) {
    return request({
        url: '/yarn_package/add',
        method: 'post',
        data,
        type: 'json',
        isYarn: true
    }, callBack)
}

// 码单列表
export function getClothNoteList(data, callBack) {
    return request({
        url: '/grey_cloth_note/list',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 码单详情
export function getClothNoteDetail(data, callBack) {
    return request({
        url: '/grey_cloth_note/detail/',
        method: 'get',
        data,
        isYarn: true,
        isJoin: true
    }, callBack)
}

// 码单增加
export function getClothNoteAdd(data, callBack) {
    return request({
        url: '/grey_cloth_note/add',
        method: 'post',
        data,
        isYarn: true,
        type: 'json'
    }, callBack)
}

// 扫码根据taskId获取坯布数据
export function getClothNoteByTaskId(data, callBack) {
    return request({
        url: '/grey_cloth/get_by_task/',
        method: 'get',
        data,
        isYarn: true,
        isJoin: true
    }, callBack)
}

// 扫码根据id获取坯布数据
export function getClothNoteById(data, callBack) {
    return request({
        url: '/grey_cloth/get/',
        method: 'get',
        data,
        isYarn: true,
        isJoin: true
    }, callBack)
}

// 码单接收
export function getClothNoteReceive(data, callBack) {
    return request({
        url: '/grey_cloth_note/receive',
        method: 'post',
        data,
        isYarn: true,
        isFile: true
    }, callBack)
}

// 码单确认
export function getClothNoteConfirm(data, callBack) {
    return request({
        url: '/grey_cloth_note/confirm',
        method: 'post',
        data,
        isYarn: true,
        isFile: true
    }, callBack)
}

// 码单详情
export function getClothNoteByDetail(data, callBack) {
    return request({
        url: '/grey_cloth_note/detail',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 根据编号id查询盘点
export function getYarnStockByYarnId(data, callBack) {
    return request({
        url: '/yarn_store_check/latest_by_standard',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 余纱退回列表
export function getWeavingYarnBack(data, callBack) {
    return request({
        url: '/yarn_package/list_4_weaving_back',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 入库区域变更
export function getYarnPackageArea(data, callBack) {
    return request({
        url: '/yarn_package/change_area',
        method: 'post',
        data,
        isYarn: true,
        type: 'json'
    }, callBack)
}

// 织造纱库  纱线跟踪
export function getYarnStandardList(data, callBack) {
    return request({
        url: '/yarn_standard/list',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 输入出库数 直接出库 针对老库存
export function getYarnStoreOutCheck(data, callBack) {
    return request({
        url: '/yarn_store_out/out_4_weaving_from_check',
        method: 'post',
        data,
        isYarn: true,
        type: 'json'
    }, callBack)
}

// 合纱出库
export function getYarnStoreOutMerge(data, callBack, callErr) {
    return request({
        url: '/yarn_store_out/out_4_yarn_merge',
        method: 'post',
        data,
        type: 'json',
        isYarn: true,
    }, callBack, callErr)
}

// 根据规格ID获取批次
export function getYarnLotNumList(data, callBack) {
    return request({
        url: '/yarn_standard_batch/list',
        method: 'get',
        data,
        isYarn: true,
    }, callBack)
}

// 根据盘库id 获取数据/出库
export function getYarnStoreByStoreId(data, callBack) {
    return request({
        url: '/yarn_store_check/single',
        method: 'get',
        data,
        isYarn: true,
        isJoin: true
    }, callBack)
}

// 盘库列表
export function getClothStoreList(data, callBack) {
    return request({
        url: '/grey_cloth_store_check/list',
        method: 'get',
        data,
        isYarn: true,
    }, callBack)
}

// 盘库列表编辑
export function greyClothStoreCheck(data, callBack) {
    return request({
        url: '/grey_cloth_store_check/check',
        method: 'post',
        data,
        isYarn: true,
        type: 'json'
    }, callBack)
}

// 样品列表
export function getClothSampleList(data, callBack) {
    return request({
        url: '/cloth_sample/list',
        method: 'get',
        data,
        isYarn: true,
    }, callBack)
}

// 样品列表 新增
export function getClothSampleStoreCheck(data, callBack) {
    return request({
        url: '/cloth_sample/add',
        method: 'post',
        data,
        isYarn: true,
        type: 'json'
    }, callBack)
}

// 获取上传key
export function getByUploadKey(data, callBack) {
    return request({
        url: '/resource/gen_upload_token',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// taskId 获取纱线信息
export function getYarnPlanInfo(data, callBack) {
    return request({
        url: '/sample_yarn_4_plan/list_4_craft',
        method: 'get',
        data,
        isYarn: true,
        isFile: true
    }, callBack)
}

// 纱线新增
export function getYarnStandardAdd(data, callBack) {
    return request({
        url: '/yarn_standard/analyse_no_4_add',
        method: 'post',
        data,
        isFile: true,
        isYarn: true
    }, callBack)
}


//纱包移区
export function moveStoreArea(data, callBack) {
    return request({
        url: '/yarn_package/move_area',
        method: 'post',
        data,
        isYarn: true,
        type: 'json'
    }, callBack)
}

//纱线颜色过滤
export function filterYarnColor(data, callBack) {
    return request({
        url: '/yarn_standard/filter_color',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

//纱线批次
export function listYarnBatchByYarn(data, callBack) {
    return request({
        url: "/spinning_feed/list_batch_by_yarn",
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

//解析纱号
export function analyseYarnNo(data, callBack) {
    return request({
        url: "/yarn_standard/analyse_no",
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

//确认盘库
export function confirmYarnCheck(data, callBack) {
    return request({
        url: '/yarn_store/check',
        method: 'post',
        data,
        isYarn: true,
        type: 'json'
    }, callBack)
}

//筛选纱线盘库
export function filterYarnCheckData(data, callBack) {
    return request({
        url: "/yarn_store/filter_check_by_yarn",
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

//纱线盘库详情
export function yarnCheckDetail(data, callBack) {
    return request({
        url: "/yarn_store/check_detail",
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

//仓库出库
export function yarnStoreOut(data, callBack) {
    return request({
        url: '/yarn_package/store_out',
        method: 'post',
        data,
        isYarn: true,
        type: 'json'
    }, callBack)
}

//细纱批次列表
export function loadYarnBatchData(data, callBack) {
    return request({
        url: "/yarn_store/list_4_batch_by_yarn",
        method: "get",
        data,
        isYarn: true,
        isEmpty: true,
    }, callBack);
}

//细纱批次列表
export function loadYarnData(data, callBack) {
    return request({
        url: "/yarn_store/list_4_yarn",
        method: "get",
        data,
        isYarn: true,
        isEmpty: true,
    }, callBack);
}

//细纱批次区域
export function loadYarnAreaData(data, callBack) {
    return request({
        url: "/yarn_store/list_4_area_by_batch",
        method: "get",
        data,
        isYarn: true,
        isEmpty: true,
    }, callBack);
}

//纱样取用
export function yarnSampleOut(data, callBack) {
    return request({
        url: "/yarn_standard/sample_out",
        method: "post",
        data,
        isYarn: true,
        isFile: true,
    }, callBack);
}

//纱样归还
export function yarnSampleIn(data, callBack) {
    return request({
        url: "/yarn_standard/sample_in",
        method: "post",
        data,
        isYarn: true,
        isFile: true,
    }, callBack);
}

/* 新增纱线码单 */
export function addSpinningNote(data, callback) {
    return request({
        url: "/spinning_note/add",
        method: "post",
        data,
        isYarn: true,
        type: 'json'
    }, callback);
}

/* 更改码单 */
export function changeSpinningNote(data, callback) {
    return request({
        url: "/spinning_note/change",
        method: "post",
        data,
        isYarn: true,
        type: 'json'
    }, callback);
}

/* 加载纱线码单列表 */
export function loadSpinningNoteData(data, callback) {
    return request({
        url: "/spinning_note/list",
        method: "get",
        data,
        isYarn: true,
    }, callback);
}

/* 删除码单 */
export function delSpinningNote(data, callback) {
    return request({
        url: "/spinning_note/del",
        method: "post",
        data,
        isYarn: true,
        isFile: true,
    }, callback);
}

/* 纺纱码单字段过滤 */
export function filterSpinningNoteKey(data, callback) {
    return request({
        url: "/spinning_note/filter_by_key",
        method: "get",
        data,
        isYarn: true,
    }, callback);
}

/* 确认码单详情 */
export function confirmSpinningNoteDetail(data, callback) {
    return request({
        url: "/spinning_note/change_detail",
        method: "post",
        data,
        isYarn: true,
        type: 'json'
    }, callback);
}

/* 删除详情包 */
export function delSpinningNoteDetail(data, callback) {
    return request({
        url: "/spinning_note/del_detail",
        method: "post",
        data,
        isYarn: true,
        isFile: true,
    }, callback);
}

/* 码单详情 */
export function spinningNoteDetail(data, callback) {
    return request({
        url: "/spinning_note/detail",
        method: "get",
        data,
        isYarn: true,
    }, callback);
}


// 获取细纱详情 按扫码
export function loadYarnDetailByCode(data, callBack) {
    return request({
        url: "/yarn_store/detail_by_code",
        method: "get",
        data,
        isYarn: true
    }, callBack)
}
